InputDelegate

Kind of class:class
Inherits from:EventDispatcher
Classpath:gfx.managers.InputDelegate
File last modified:Tuesday, 29 June 2010, 09:03:27
InputDelegate receives commands from the game, by intercepting keys, controller buttons, etc, and dispatches Input events. InputDetail objects are generated containing a navigation equivelant. FocusHandler will instantiate an InputDelegate when input is required.

Summary


Constructor
Class properties
  • instance
    • Returns the Singleton instance of the InputDelegate
Class methods
Instance methods
  • setKeyRepeat
    • Enable or disable key repeat for a specific keycode for specified controller.
  • readInput
    • Request input from the game engine.
  • inputToNav
    • Convert input to readable navigation commands

Constructor

InputDelegate

function InputDelegate (
)

Create a new InputDelegate instance. This method should only be called internally by the InputDelegate class, as the implementation is a Singleton.

Class properties

instance

static instance:InputDelegate
(read)

Returns the Singleton instance of the InputDelegate

Instance methods

inputToNav

function inputToNav (
type:String, code:Number, value) : String

Convert input to readable navigation commands
Parameters:
type :
The type of interaction
code :
The numeric code of the input
value:
Additional details from the input
Returns:
  • The navigation equivalent String.

readInput

function readInput (
type:String, code:Number, scope:Object, callBack:String) : Object

Request input from the game engine.
Parameters:
type :
The type of the required interaction.
code :
The code of the required input.
scope :
The scope of the callBack.
callBack:
The function name of the callBack.
Returns:
  • An Object containing relevant information about the requested input.

setKeyRepeat

function setKeyRepeat (
code:Number, value:Boolean, controllerIdx:Number) : Void

Enable or disable key repeat for a specific keycode for specified controller. Only applicable if system key repeat is on.
Parameters:
code :
The key code for the key.
value:
The repeat state.